package 美团;

public class _69_x的平方根 {
    public int mySqrt(int x) {
        int res = 0;
        while (res <= x) {
            int temp = res * res;
            if (temp > x) return res - 1;
            if (temp == x) return res;
            res++;
        }
        return 0;
    }
}
